//
//  NSString+Extension.m
//  我是采购
//
//  Created by 张浩 on 15/10/12.
//  Copyright © 2015年 张浩. All rights reserved.
//

#import "NSString+Extension.h"

@implementation NSString (Extension)
+ (NSString *)transformToPinyinWithString:(NSString *)string {
    NSMutableString *mutableString = [NSMutableString stringWithString:string];
    CFStringTransform((CFMutableStringRef)mutableString, NULL, kCFStringTransformToLatin, false);
    mutableString = (NSMutableString *)[mutableString stringByFoldingWithOptions:NSDiacriticInsensitiveSearch locale:[NSLocale currentLocale]];
    return mutableString;
}

- (NSString *)firstLetter
{
    return [self substringToIndex:1];
}
@end
